﻿using System;
using System.Windows;
namespace POS
{
    public class Drink : Order, IOrderable, IRenderable
    // NOTE: I don't think Drinkable is a good choice, maybe static Enum in this class dunno... The same goes for Edible in the Food class.
    {
        public Drink(string name, double price, double rating, DrinkOptions.Size size, DrinkOptions.Type type)
            : base(name, price, rating)
        {
            this.Type = type;
            this.Size = size;
        }

        public DrinkOptions.Size Size { get; private set; }
        public DrinkOptions.Type Type { get; private set; }      

        public override string ToString()
        {
            return String.Format("Drink '{0}' Type '{1}' Size '{2}'", this.Name, this.Type, this.Size);
        }

        public override int GetHashCode()
        {
            return this.Name.GetHashCode() + this.Type.GetHashCode() + this.Size.GetHashCode();
        }

        public override bool Equals(object obj)
        {
            if (obj is Drink)
            {
                Drink drink = obj as Drink;
                if (this.GetHashCode() == drink.GetHashCode())
                {
                    return true;
                }
                return false;
            }
            return false;
        }

        public double OrderPrice()
        {
            return this.Price;
        }

        public bool Orderable()
        {
            // TODO: make checks if we have the ingredients in the constructor.
            return true;
        }

        public UIElement Render()
        {
            //TODO : implement the method
            throw new NotImplementedException();
        }
    }
}
